﻿using Common;
using CommonModel.Config;
using IBll;

namespace Bll
{
    /// <summary>
    /// 验证服务
    /// </summary>
    public class AuthorizationBll : IAuthorizationBll
    {
        public ICacheBll CacheBll { get; set; }

        /// <summary>
        /// 登录验证
        /// </summary>
        /// <returns></returns>
        public bool LoginAuthorization()
        {
            bool result = false;
            string cookieValue = "";

            cookieValue = CookieHelper.GetCookieValue(CookieConfig.LoginCookieName);
            if (!string.IsNullOrEmpty(cookieValue))
            {
                if (CacheBll.IsExists(cookieValue))
                {
                    result = true;
                }
            }

            return result;
        }
    }
}
